﻿//Write a program that finds the biggest of three integers using nested if statements.

using System;

class GetMaxOf3Numbers
{
    static void Main()
    {
        int numbersCount = 3;
        int numberMax = 0;
        for (int i = 1; i <=numbersCount; i++)
        {
            Console.Write("Enter integer number {0}: ", i);
            string numberString = Console.ReadLine();
            int number;
            while (!int.TryParse(numberString, out number))
            {
                Console.Write("Invalid number. Input number {0} again: ", i);
                numberString = Console.ReadLine();
            }
            if (i == 1 && (numberMax != number))
            {
                numberMax = number;
            }
            else
            {
                if (number > numberMax)
                {
                    numberMax = number;
                }
            }
        }
        Console.WriteLine("The biggest integer number is: {0}", numberMax);
    }
}
